import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/register.vue"),
  },
  {
    path: "/",
    name: "index",
    component: () => import("../views/index.vue"),
    children: [
      {
        // 详情页，通过id来获取文章信息
        path: "/detail/:id",
        name: "detail",
        component: () => import("../views/detail.vue"),
      },

      {
        path: "/fabu",
        name: "fabu",
        component: () => import("../views/fabu.vue"),
      },
      {
        path: "/biaoqian",
        name: "biaoqian",
        component: () => import("../views/biaoqian.vue"),
      },
      {
        path: "/fenlei",
        name: "fenlei",
        component: () => import("../views/fenlei.vue"),
      },
      {
        path: "/shouye",
        name: "shouye",
        component: () => import("../views/shouye.vue"),
      },
      {
        path: "/lixiang",
        name: "lixiang",
        component: () => import("../views/lixiang.vue"),
      },
      {
        path: "/jishuzhan",
        name: "jishuzhan",
        component: () => import("../views/jishuzhan.vue"),
      },
      {
        path: "/fenxi",
        name: "fenxi",
        component: () => import("../views/fenxi.vue"),
      },
      {
        path: "/duanwen",
        name: "duanwen",
        component: () => import("../views/duanwen.vue"),
      },

      {
        path: "/labcloud",
        name: "labcloud",
        component: () => import("../views/labcloud.vue"),
      },
      {
        path: "/hotpage",
        name: "hotpage",
        component: () => import("../views/hotpage.vue"),
      },
      {
        path: "/newping",
        name: "newping",
        component: () => import("../views/newping.vue"),
      },
      {
        path: "/history",
        name: "history",
        component: () => import("../views/history.vue"),
      },
      {
        path: "/huishou",
        name: "huishou",
        component: () => import("../views/huishou.vue"),
      }
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
